<?php
/**
 * CreateTime: 2022/5/10 16:19
 */

namespace App\Tools\DingTalk\DingTalkCover;

use Darabonba\OpenApi\Models\Config;
use AlibabaCloud\SDK\Dingtalk\Vworkflow_1_0\Dingtalk;

trait DingTalkVDrive1_0CoverBasic
{
    private static function setNewVDrive1_0ClientClient(): DingTalkVDrive
    {
        $config = new Config([]);
        $config->protocol = "https";
        $config->regionId = "central";
        return new DingTalkVDrive($config);
    }

    /**
     * 使用 Token 初始化账号Client
     * @return Dingtalk Client
     */
    private static function setCreateClient(){
        $config = new Config([]);
        $config->protocol = "https";
        $config->regionId = "central";
        return new Dingtalk($config);
    }


    private static function getCreateClient(){
        return self::setCreateClient();
    }


    /**
     * 新版 获取钉钉客户端
     * @return \AlibabaCloud\SDK\Dingtalk\Voauth2_1_0\Dingtalk
     */
    protected static function getDrive1_0ClientClient(): DingTalkVDrive
    {
        return self::setNewVDrive1_0ClientClient();
    }
}